package cqie.cn.frame.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;


import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author 王林
 * @since 2021-09-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "SysUser对象", description = "用户表")
public class SysUser extends Model<SysUser> {

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "姓名", required = true)
    private String name;

    @ApiModelProperty(value = "账号", required = true)
    private String account;

    @ApiModelProperty(value = "MD5加密", required = true)
    private String password;

    @ApiModelProperty(value = "0:正常；1：禁用", required = true)
    //逻辑删除
    @TableLogic
    //有些字段，需要设置为null，更新到数据库，可以采用下面这个注解：
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Integer status;

    @ApiModelProperty(value = "创建时间")
//    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
//    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//数据库显示到前端
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


}
